<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
	
<script th:inline="javascript">
/*<![CDATA[*/
$(function(){
    xf.ns('xf.admin.menu[[${OP.menuId}]]');
    $('#admin_menu[[${OP.menuId}]]_datagrid').bootstrapTable({ 
        url:'/xf-web'+[[${MENU.menuUrl}]]+'/selectSysRoleList.do',
        height: '100%',
        sortName: 'name',
        sortOrder: 'desc',
        striped: true,
        pagination: true,
        pageSize: 10,
        pageList: [10, 25, 50, 100, 200],
        columns: [{
            checkbox: true
        }, {
            field: 'roleId',
            title: '编号',
            visible : false
        }, {
            field: 'roleName',
            title: '角色名称',
            align: 'center',
            valign: 'middle'
        }, {
            field: 'roleCode',
            title: '角色代码',
            align: 'center',
            valign: 'middle'
        },{
            field: 'status',
            title: '角色状态',
            align: 'center',
            valign: 'middle'
        },{
            field: 'createDate',
            title: '创建日期',
            align: 'center',
            valign: 'middle'
        },{
            field: 'createTime',
            title: '创建时间',
            align: 'center',
            valign: 'middle'
        }]
  	});
})


//传递的参数
// function queryParams(params) {
// 	var pageSize = params.limit;
// 	var sort = params.sort;
// 	var offset = params.offset;
// 	var order = params.order;
// 	var pageNum = offset / pageSize + 1;
// 	var temp={
//    		pageSize : pageSize,
//    		pageNum : pageNum,
//    		sort : sort,
//    		order : order
//     }
// //     var data=serializeForm("admin_menu${OP.menuId}_formSearch");
// //     $.extend(temp,data);
//     return temp;
// }

//新增
xf.admin.menu[[${OP.menuId}]].add = function(){
	xf.showWindow({
			title:'增加角色',
			href:'/xf-web/op_edit_[[${OP.menuId}]].do',
			width:'50%',
			height:'40%',
			okhandler:function(){
				xf.admin.menu[[${OP.menuId}]].save();
			},
			cancelhandler:function(){
				xf.closeWindow();
			}
		});
}

/*]]>*/
</script>



<div class="wrapper wrapper-content animated fadeInRight">
	<div class="ibox float-e-margins">
		<div class="ibox-content">
		<div class="panel panel-default">
			<div class="panel-heading">查询条件</div>
				<div class="panel-body">
					<form id="admin_menu${OP.menuId}_formSearch" class="form-horizontal">
						<div class="form-group" style="margin-top: 15px">
							<label class="control-label col-sm-1" for="txt_search_departmentname">角色名称</label>
							<div class="col-sm-2">
								<input type="text" class="form-control" name="roleName" id="roleName">
							</div>
							<div class="col-sm-12" style="text-align: right;">
								<button type="button"  onclick = "xf.admin.menu${OP.menuId}.serach();"
									class="btn btn-primary"><i class="fa fa-search"></i>查询</button>
							    <button type="button" class="btn btn-white" onclick="xf.admin.menu${OP.menuId}.clearForm();"><i class="fa fa-eraser"></i>重置</button>
							</div>
						</div>
					</form>
				</div>
			</div>
		
			<div th:include="toolbar :: toolbar-operate"></div>
			
			<div class="table-responsive">
<!-- 			    <div class="panel panel-default"> -->
<!-- 					<div class="panel-heading">列表</div> -->
					<table th:id="@{admin_menu{menuId}_datagrid(menuId=${OP.menuId})}"
						data-toolbar="#toolbar" data-show-refresh="true"
						data-show-toggle="true" data-show-columns="true"
						data-show-footer="false" data-mobile-responsive="true">
					</table>
<!-- 				</div> -->
			</div>
		</div>
	</div>
</div>
</html>